<@master template="master/master-loan"  title="我要贷款_怡亚通380金服_综合金融服务_供应链融资">
 <form id="subForm" action="/applyLoan/rest/submit" class="action-ajax-form" method="POST">
 <div class="dkBanner">
    	<div class="mainbox pr" style=" height:580px;">
            <div class="dkText">
            	<p>借款额度：<span class="yellow1">5-50</span>万</p>
            	<p>借款期限：<span class="yellow1">6-12</span>个月</p>
            	<p>还款方式：按月付息、到期还本</p>
            	<p>费率说明：年化<span class="yellow1">14%</span>，月息仅<span class="yellow1">1.17</span>分</p>
            	<p>审批时间：资料齐全3-5天放款</p>
            </div>
            <div class="dkBarBox">
            	<div class="dksqBox dkJq">
					<strong class="kssq">快速申请</strong>
                	<ul>
                    	<li class="clearfix"><span class="dKSpan">姓名</span><div class="dkLeft"><input name="uname" type="text" class="dKInput" placeholder=" 请填写姓名"></div></li>
                        <li class="clearfix"><span class="dKSpan">手机号码</span><div class="dkLeft"><input name="telphone" type="text" class="dKInput" placeholder=" 请填写手机号码""></div></li>
                        <li class="clearfix"><span class="dKSpan">身份证号</span><div class="dkLeft"><input name="idCard" type="text" class="dKInput"  placeholder=" 请填写身份证号码"></div></li>
                        <li class="clearfix">
                        	<span class="dKSpan">借款金额</span>
                        	<div class="dkLeft">
                            	<select  id="loanMoneySelect" name="loanMoney" style="width:280px;">
                            		<option value="请选择">请选择</option>
	                            	<option value="10">10万</option>
	                            	<option value="15">15万</option>
	                            	<option value="20">20万</option>
	                            	<option value="25">25万</option>
	                            	<option value="30">30万</option>
	                            	<option value="35">35万</option>
	                            	<option value="40">40万</option>
	                            	<option value="45">45万</option>
	                            	<option value="50">50万</option>
                            	</select>
                             </div>
                        </li>
                        <li class="clearfix">
                        	<span class="dKSpan">借款期限</span>
                        	<div class="dkLeft">
                            	<select  id="loanTimeSelect" name="loanTime" style="width:280px;">
                            		<option value="请选择">请选择</option>
	                            	<option value="6">6个月</option>
	                            	<option value="12">12个月</option>
                            	</select>
                             </div>
                        </li>
                    </ul>
                    <p class="red wrong"></p>
                    <a id="nextStep" href="#" class="xybBtn xyPr dkBtnJq">下一步</a>
                </div>
                <div class="dksqBox1 dkJq2" >
					<strong class="kssq">快速申请</strong>
                	<ul>
                    	<li class="clearfix"><span class="dKSpan">门店名称</span><div class="dkLeft"><input name="officeName" type="text" class="dKInput" placeholder="请填写营业执照上的名称"></div></li>
                        <li class="clearfix">
	                        <span class="dKSpan">门店注册时间</span>
	                        <div class="dkLeft">
		                        <input placeholder="请输入日期" name="registerTime" class="laydate-icon" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})">
							    <span class="action-field-error" for="loanDate" style="color:red;"></span>
	                        </div>
                        </li>
                        <li id="city" class="clearfix">
                       		<span class="dKSpan">门店地址</span>
					        <div class="dkLeft">
					         	<select  id="provSelect" name="province" class="prov"></select>&nbsp;
					            <select  name="city" class="city ml10" disabled="disabled""></select>&nbsp;
					        </div>
                        </li>
                        <li class="clearfix"><span class="dKSpan">门店详细地址</span><div class="dkLeft"><input name="detailAddress" type="text" class="dKInput" placeholder="请填写门店详细地址"></div></li>
                        <li class="clearfix">
                        	<span class="dKSpan" style="line-height:20px; ">与怡亚通合作平台</span>
                        	<div class="dkLeft">
					         	<select  id="platformDiv" name="cooperatePlatform" style="width:280px;">
					         		<option value="请选择">请选择</option>
					         	</select>
					        </div>
                        </li>
                        <li class="clearfix">
                        	<span class="dKSpan" style="line-height:20px;">与怡亚通合作时间</span>
                            <div class="dkLeft">
                            	<select  name="cooperateTime" style="width:280px;">
                            		<option value="请选择">请选择</option>
	                            	<option value="6个月">6个月</option>
	                            	<option value="7个月">7个月</option>
	                            	<option value="8个月">8个月</option>
	                            	<option value="9个月">9个月</option>
	                            	<option value="10个月">10个月</option>
	                            	<option value="11个月">11个月</option>
	                            	<option value="12个月及以上">12个月及以上</option>
                            	</select>
                             </div>
                        </li>
                    </ul>
                    <p class="red wrong"  style="left:98px;"></p>
                    <a id="submitBtn" href="#" class="xybBtn xyPr" style="bottom:45px;">提交</a>
                    <a href="#" class=" dkBtnJq1 sybBtn">上一步</a>
                </div>
            </div>
        </div>
    </div>
    <div class="mt20 bor2 dkMainbox pr">
    	<h2>申请流程</h2>
        <span class="dkline"></span>
      	<div class="sqlcbox clearfix">
        	
       		<ul>
            	<li>
                	<div class="sqPic"><span class="dkIco dkIco1"></span></div>
                    1、提交贷款申请
                </li>
                <li>
                	<div class="sqPic"><span class="dkIco dkIco2"></span></div>
                    2、信贷经理与您联系
                </li>
                <li>
                	<div class="sqPic"><span class="dkIco dkIco3"></span></div>
                    3、提交材料，审核贷款
                </li>
                <li>
                	<div class="sqPic"><span class="dkIco dkIco4"></span></div>
                    4、面签合同
                </li>
                <li>
                	<div class="sqPic"><span class="dkIco dkIco5"></span></div>
                    5、银行放款
                </li>
          	</ul>
        </div>
    </div>
    <div class="mt20 bor2 dkMainbox clearfix">
		<div class="dkBoxLeft b_r">
        	<h2>贷款所需材料</h2>
            <div class="dkboxList c666">
            	<p>1、身份证（必须）；</p>
            	<p>2、结婚证（已婚提供）； </p>
            	<p>3、营业执照（必须）；   </p>          
            	<p>4、门店租赁合同/门店房产证（必须）；</p>
            	<p>5、银行流水（近6个月，必须）；</p>
            	<p>6、销售单据（与怡亚通的往来单据，至少3张）； </p>
            	<p>7、近6个月销售汇总表（如有）； </p>
            	<p>8、房产证、行驶证（如有）；</p>
            </div>
        </div>
        <div class="dkBoxLeft" style="padding-left:30px;">
        	<h2>申请条件</h2>
            <div class="dkboxList c666">
            	<p>1、与怡亚通有业务合作6个月以上</p>
            	<p>2、门店或企业成立时间2年 </p>
            	<p>3、18-65周岁  </p>
            </div>
        </div>
    </div>
    <input name="loanType" type="hidden" value="终端贷">
    </form>
	<@include file="/common/footer2"/>
	
	
	 <@js src="/js/jrd/laydate/laydate.js"/><@jsRender/>
<@js>  
	$(document).ready(function(){
		$('.dkBtnJq1').click(function(){
			$('.dkJq2').animate({top:'550px'});	
			$('.dkJq').animate({top:'10px'});	
		});
		$('div.selDUl li').click(function (){
			var $this = $(this);//转成jq对象
			var val = $this.attr('data-value');//找到li上面的对应的值
			var $text = $this.closest('div.selBox').find('.js-sel-value');//向上找到容器再找到对应请选择的节点
			$text.html(val);//把值放到节点上。
			$('.selDUl').hide();
		});  
		var unLoanCity = ["内蒙古","甘肃","新疆","宁夏","青海","西藏"];
		var flag = 0;
		for (var i = 0,len = citylist.citylist.length; i < len; i++ ) {
			for (var j = 0,len1 = unLoanCity.length; j < len; j++ ) {
				if (citylist.citylist[i - flag].p == unLoanCity[j]) {
					(citylist.citylist).splice((i - flag),1);
					flag++;
				}
			}
		}
		$("#city").citySelect({ required: false});	
		$('#provSelect').bind('change',function(){
			var provinceAddress=$('#subForm select[name="province"]').val();
			$.get("/applyLoan/rest/getCooperation", {"province":provinceAddress}, function(msg) {
				var jsonObj = eval('(' + msg.data + ')');
				var arr=[];
				arr.push('<option value="">请选择</option>');
				$(jsonObj).each(function(i,item){
					arr.push('<option value="'+item.orgName+'">'+item.orgName+'</option>');
				});
				$('#platformDiv').html(arr.join(''));
			});	
		})
		$("#nextStep").bind("click",function(){
				var _this = $(this);
	    		var uname = $("input[name='uname']").val();
	    		if(!uname){
	    			$('.wrong:first').text('姓名不能为空');
	    			return false;
	    		}
	    		var telphone = $("input[name='telphone']").val();
	    		var mobileCheck = $.fn.validate.mobile(telphone);
	    		if(!mobileCheck.isSuccess){
	    			$('.wrong:first').text(mobileCheck.errorMsg);
	    			return false;
	    		}
	    		var idCard = $("input[name='idCard']").val();
	    		var idCardCheck = $.fn.validate.idCard(idCard);
	    		if(!idCardCheck.isSuccess){
	    			$('.wrong:first').text(idCardCheck.errorMsg);
	    			return false;
	    		}
	    		var loanMoney = $("#loanMoneySelect").val();
	    		if(loanMoney=="请选择"){
	    			$('.wrong:first').text('借款金额不能为空');
	    			return false;
	    		}
	    		var loanTime = $("#loanTimeSelect").val();
	    		if(loanTime=="请选择"){
	    			$('.wrong:first').text('借款期限不能为空');
	    			return false;
	    		}
	    		
	    		$('.dkJq').animate({top:'-550px'});	
				$('.dkJq2').animate({top:'10px'});
				$('.wrong:first').text('');	
			});
			
			$("#submitBtn").bind("click",function(){
				var _this = $(this);
	    		var officeName = $("input[name='officeName']").val();
	    		if(!officeName){
	    			$('.wrong:last').text('门店名称不能为空');
	    			return false;
	    		}
	    		var registerTime = $("input[name='registerTime']").val();
	    		if(!registerTime){
	    			$('.wrong:last').text('门店注册时间');
	    			return false;
	    		}
	    		var province =$("select[name='province']").val();
	    		var city =$("select[name='city']").val();
	    		if(!province || !city){
	    			$('.wrong:last').text('门店地址不能为空');
	    			return false;
	    		}
	    		var detailAddress = $("input[name='detailAddress']").val();
	    		if(!detailAddress){
	    			$('.wrong:last').text('门店详细地址不能为空');
	    			return false;
	    		}
	    		var cooperatePlatform = $("#platformDiv").val();
	    		if(cooperatePlatform=="请选择"){
	    			$('.wrong:last').text('与怡亚通合作平台不能为空');
	    			return false;
	    		}
	    		var cooperateTime =$("select[name='cooperateTime']").val();
	    		if(cooperateTime=="请选择"){
	    			$('.wrong:last').text('与怡亚通合作时间不能为空');
	    			return false;
	    		}
				$('.wrong:last').text('');	
				$.ajax({
		    			url:"/applyLoan/rest/submit",
		    			data:$("#subForm").serializeArray(),
		    			success:function(msgResult){
		    				if(msgResult.data.success == true){
		    					window.location.href="/applyLoan/applySuccess";
		    				}else{
		    					$('.wrong:last').text(msgResult.data.errMsg);	
		    				}
		    			}
		    		});
			});
		
	})
	</@js>
	<@jsRender/>  	
</@master>	